using IQIGame.Onigao.Framework;

namespace IQIGame.Onigao.Logic
{
    /// <summary>
    /// 服务触发器工厂
    /// </summary>
    public sealed class ServiceFactory
    {
        /// 获取服务触发器
        /// </summary>
        /// <param name="triggerID"></param>
        /// <returns></returns>
        public static BaseServiceTrigger CreateTrigger(ServiceTriggerType triggerType)
        {
            BaseServiceTrigger trigger = null;
            switch (triggerType)
            {
                case ServiceTriggerType.MoveInRange:
                    trigger = ClassPool.Get<TrigMoveInRange>();
                    break;
                case ServiceTriggerType.EntityState:
                    trigger = ClassPool.Get<TrigEntityState>();
                    break;
                case ServiceTriggerType.SwitchPhysicalArea:
                    trigger = ClassPool.Get<TrigEnterOrLeaveSpeRoom>();
                    break;
                case ServiceTriggerType.EnterOrLeaveArea:
                    trigger = ClassPool.Get<TrigEnterOrLeaveArea>();
                    break;
                case ServiceTriggerType.EndBattle:
                    trigger = ClassPool.Get<TrigEndBattle>();
                    break;
                case ServiceTriggerType.ElevatorArrive:
                    trigger = ClassPool.Get<TrigElevatorArrive>();
                    break;
                case ServiceTriggerType.None:
                case ServiceTriggerType.Interact:
                case ServiceTriggerType.UnderAttack:
                case ServiceTriggerType.EntityStopNavigation:
                case ServiceTriggerType.NoServiceTiggeredWhenInteract:
                case ServiceTriggerType.EntityBorn:
                case ServiceTriggerType.TeleportArrive:
                case ServiceTriggerType.EnterRegion:
                    trigger = ClassPool.Get<TrigGeneral>();
                    break;
                default:
                    LogicLog.LogError($"not support Trigger : {triggerType}");
                    break;
            }
            return trigger;
        }

        /// <summary>
        /// 获取服务行为的执行
        /// </summary>
        /// <param name="executionType"></param>
        /// <returns></returns>
        public static BaseServiceExecution CreateExecution(ServiceExecutionType executionType)
        {
            BaseServiceExecution execution = null;
            switch (executionType)
            {
                case ServiceExecutionType.GenerateEntity:
                    execution = ClassPool.Get<ExecGenerateEntity>();
                    break;
                case ServiceExecutionType.RemoveEntity:
                    execution = ClassPool.Get<ExecRemoveEntity>();
                    break;
                case ServiceExecutionType.ShowSpeechBubble:
                    execution = ClassPool.Get<ExecShowSpeechBubble>();
                    break;
                case ServiceExecutionType.Teleport:
                    execution = ClassPool.Get<ExecTeleport>();
                    break;
                case ServiceExecutionType.ChangeExecutionCounts:
                    execution = ClassPool.Get<ExecChangeExecutionCounts>();
                    break;
                case ServiceExecutionType.ChangeService:
                    execution = ClassPool.Get<ExecChangeService>();
                    break;
                case ServiceExecutionType.ChangeLevelParams:
                    execution = ClassPool.Get<ExecChangeLevelParams>();
                    break;
                case ServiceExecutionType.AutoNavigation:
                    execution = ClassPool.Get<ExecAutoNavigation>();
                    break;
                case ServiceExecutionType.EnableServiceUnit:
                    execution = ClassPool.Get<ExecEnableServiceUnit>();
                    break;
                case ServiceExecutionType.Battle:
                    execution = ClassPool.Get<ExecBattle>();
                    break;
                case ServiceExecutionType.FollowHero:
                    execution = ClassPool.Get<ExecFollowHero>();
                    break;
                case ServiceExecutionType.ChangeEntityActivation:
                    execution = ClassPool.Get<ExecChangeEntityActivation>();
                    break;
                case ServiceExecutionType.UseElevtor:
                    execution = ClassPool.Get<ExecUseElevator>();
                    break;
                case ServiceExecutionType.ChangeInteractType:
                    execution = ClassPool.Get<ExecChangeInteractType>();
                    break;
                case ServiceExecutionType.SwitchElevatorFloor:
                    execution = ClassPool.Get<ExecSwitchElevatorFloor>();
                    break;
                case ServiceExecutionType.SetObstacleActivation:
                    execution = ClassPool.Get<ExecSetObstacleActivation>();
                    break;
                case ServiceExecutionType.PlayEntityAnimation:
                    execution = ClassPool.Get<ExecPlayEntityAnimation>();
                    break;
                case ServiceExecutionType.CameraMotion:
                    execution = ClassPool.Get<ExecStartCameraMotion>();
                    break;
                case ServiceExecutionType.UpdateTimeEnvShow:
                    execution = ClassPool.Get<ExecUpdateTimeEnvShow>();
                    break;
                case ServiceExecutionType.ChangeSceneEffect:
                    execution = ClassPool.Get<ExecChangeSceneEffect>();
                    break;
                case ServiceExecutionType.CallElevator:
                    execution = ClassPool.Get<ExecCallElevator>();
                    break;
                case ServiceExecutionType.ApplyRoutineAct:
                    execution = ClassPool.Get<ExecApplyRoutineAct>();
                    break;
                case ServiceExecutionType.PushEntityFourWay:
                    execution = ClassPool.Get<ExecPushEntityFourWay>();
                    break;
                case ServiceExecutionType.ResetEntity:
                    execution = ClassPool.Get<ExecResetEntity>();
                    break;
                case ServiceExecutionType.ActiveCheckPoint:
                    execution = ClassPool.Get<ExecActiveCheckPoint>();
                    break;
                case ServiceExecutionType.AddOrRemoveBuff:
                    execution = ClassPool.Get<ExecAddOrRemoveBuff>();
                    break;
                case ServiceExecutionType.AddBuffStack:
                    execution = ClassPool.Get<ExecAddBuffStack>();
                    break;
                case ServiceExecutionType.RelationalCalcLevelParams:
                    execution = ClassPool.Get<ExecRelationalCalcLevelParams>();
                    break;
                case ServiceExecutionType.ChangeCustomBGM:
                    execution = ClassPool.Get<ExecChangeCustomBGM>();
                    break;
                case ServiceExecutionType.StartStoryDialog:
                    execution = ClassPool.Get<ExecStartStoryDialog>();
                    break;
                case ServiceExecutionType.ChangeEntityRotation:
                    execution = ClassPool.Get<ExecChangeEntityRotation>();
                    break;
                case ServiceExecutionType.LinearMoveBySpecifiedDir:
                    execution = ClassPool.Get<ExecLinearMoveBySpecifiedDir>();
                    break;
                case ServiceExecutionType.CancelDelayService:
                    execution = ClassPool.Get<ExecCancelDelayService>();
                    break;
                case ServiceExecutionType.CancelNavigation:
                    execution = ClassPool.Get<ExecCancelNavigation>();
                    break;
                case ServiceExecutionType.ChangeCurPlayerCamera:
                    execution = ClassPool.Get<ExecChangeCurPlayerCamera>();
                    break;
                case ServiceExecutionType.ChangeWeather:
                    execution = ClassPool.Get<ExecChangeWeather>();
                    break;
                case ServiceExecutionType.SimulateTrigger:
                    execution = ClassPool.Get<ExecSimulateTrigger>();
                    break;
                case ServiceExecutionType.StartItemSubmit:
                    execution = ClassPool.Get<ExecStartItemSubmit>();
                    break;
                case ServiceExecutionType.Drop:
                    execution = ClassPool.Get<ExecDrop>();
                    break;
                case ServiceExecutionType.AddItem:
                    execution = ClassPool.Get<ExecAddItem>();
                    break;
                case ServiceExecutionType.EnableQuickBar:
                    execution = ClassPool.Get<ExecEnableQuickBar>();
                    break;
                case ServiceExecutionType.PlayOrStopEntityEffect:
                    execution = ClassPool.Get<ExecPlayOrStopEntityEffect>();
                    break;
                case ServiceExecutionType.AddHp:
                    execution = ClassPool.Get<ExecAddHp>();
                    break;
                case ServiceExecutionType.StartMiniGame:
                    execution = ClassPool.Get<ExecStartMiniGame>();
                    break;
                case ServiceExecutionType.AcceptQuest:
                    execution = ClassPool.Get<ExecAcceptQuest>();
                    break;
                case ServiceExecutionType.ChangeEntityAudio:
                    execution = ClassPool.Get<ExecChangeEntityAudio>();
                    break;
                case ServiceExecutionType.LeaveLevel:
                    execution = ClassPool.Get<ExecLeaveLevel>();
                    break;
                default:
                    break;
            }
            return execution;
        }
    }
}